1. Field of the Invention
This invention relates to a white balance compensation method and a white balance compensation system for white balance compensation of a color image.
2. Description of the Related Art
The proliferation of personal computers has led to their wide use for variously processing, outputting and reproducing images after conversion into digital image data. The digital image data are acquired by photographing a subject with a digital camera or by photographing a subject on silver-halide photographic photosensitive material and then, after development, digitizing the photographed image with a scanner or the like. In the case of a color image, the digital image data obtained in these ways are generally represented as a combination of three-color (RGB) density data. When such digital image data are displayed on a CRT or output as a hard copy such as a print, white balance compensation is effected with respect to the whole image in order to make gray objects in the photographed scene appear as gray in the reproduced CRT image or print.
Methods for white balance compensation include, for example, one used in digital cameras of computing for each of the RGB channels the mean value of the pixels in the image and adjusting the color signal gains to make all of the mean values but a selected one coincide with the selected mean value. At photo labs, white balance compensation is conducted by adjusting the printing light source so as to bring the mean transmittances of the individual RGB channels of the color negative into coincidence. In conducting these methods, it is a well-known practice to improve the accuracy of the white balance compensation by eliminating pixels having extremely high color saturation from the calculation of the mean values or the mean transmittances of the individual channels.
When white balance compensation is conducted based on the mean values or the mean transmittances of the individual RGB channels as in these methods, however, it is not possible to conduct the white balance compensation satisfactorily with high accuracy when the color balance of the photographed subject is uneven.
This invention was accomplished in light of the foregoing circumstances and has as one object to provide a white balance compensation method capable of highly accurate white balance compensation. Another object of the invention is to provide a system for implementing the method.
As dictated by commonly accepted video standards and shown by the following Equation (1), the values of the color signals (VB, VG, VR) obtained with a digital still camera or digital movie camera are ordinarily the 0.45 th power of the incident light intensities:
Vi=Ei0.45(i=B, G, R)xe2x80x83xe2x80x83(1)
Therefore, as shown by Equation (2), the mean value Vm of a color signal is the mean value of the 0.45 th power of the incident light intensity (EB, EG, ER):
Vmi=(xcexa3Vi)/M=(xcexa3Ei0.45)/Mxe2x80x83xe2x80x83(2)
where
M: Number of pixels
In a printer, on the other hand, the relationship among the transmittance Ti, density Di and incident light intensity Ei of ordinary color negative film is as shown by Equation (3):
xe2x88x92log Ti=Di=0.7 log Eixe2x80x83xe2x80x83(3)
It follows, therefore, that the mean transmittance Tm, i.e., the mean value of the transmittance Ti, is expressed by Equation (4):
Tmi=(xcexa3Ti)/M=(xcexa3Eixe2x88x920.7)/Mxe2x80x83xe2x80x83(4)
As can be seen from Equations (2) and (4), when the mean value is computed from a power of the incident light intensity, i.e., from the exponential function (Ein), the exponent n has conventionally been assigned different values, 0.45 and xe2x88x920.7, depending on whether the color signal or the transmittance is being computed. Taking note of this fact, the inventor conducted tests using mean values computed utilizing various values of an exponent coefficient p and discovered that the aforesaid white balance compensation can be effected with high accuracy when the value of p is selected within a prescribed range. This invention was accomplished based on this discovery.
Specifically, in one aspect of the present invention there is provided a white balance compensation method comprising the steps of effecting a computation on color image data constituted of color signals composed of at least three components to obtain mean values of the components and converting the color signals to make the mean values substantially equal, thereby effecting white balance compensation of an image represented by the color image data, the method being characterized in that the mean values of the components are mean values of incident light intensities raised to a power having a coefficient of p, where 0.5xe2x89xa6pxe2x89xa61.5.
xe2x80x9cColor signalxe2x80x9d as termed with respect to the invention is defined to encompass not only a color signal of a still digital camera or a digital movie camera but also the transmittance of light transmitted through color negative film.
In another aspect of the present invention there is provided a white balance compensation system comprising a mean value computing unit for effecting a computation on color image data constituted of color signals composed of at least three components to obtain mean values of the components and a convertor for converting the color signals to make the mean values substantially equal, thereby effecting white balance compensation of an image represented by the color image data, the system being characterized in that the mean value computing unit computes the mean values of the components as mean values of incident light intensities raised to a power having a coefficient of p, where 0.5xe2x89xa6pxe2x89xa61.5.
The white balance compensation method and system according to the invention compute the mean values of the color signal components as the mean values of the p-th power of the incident light intensities and use these mean values to compensate the white balance. When a given color signal is the n-th power of the incident light intensity, the mean value according to the invention is computed in accordance with Equation (5):
Vmi=f(xcexa3fxe2x88x921(Vi)/M)=((xcexa3Vip/n)/M)n/pxe2x80x83xe2x80x83(5)
where
i=B, G, R
Vmi: mean value
f(X)=Xn 
M: number of pixels
When the color signal is a log value, Equation (5) can be rewritten as Equation (6):
Vmi=n/pxc2x7(log(xcexa310Vixc2x7p/n/M)xe2x80x83xe2x80x83(6)
The white balance is compensated by converting the color signals to make all of the mean values but a selected one substantially equal to the selected mean value. The inventor conducted tests utilizing various values of the exponent p and found that an excellent image free of color failure can be obtained by reproducing color signals whose white balance has been compensated using a value of p between 0.5 and 1.5, preferably between 1.0 and 1.5. Highly accurate white balance compensation can therefore be achieved by converting color image data using the white balance compensation method and system according to the invention.